<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<style>
    body {
        background-color: #cdd7ef;
    }

    ul li {
        display: inline-block;
        padding-top: 20px;
        left: 20px;
        right: 20px;
    }

    ul li a {
        border-inline: 1px;
    }

</style>
<nav class="navbar navbar-dark bg-dark navbar-expand-md sticky-top">
    <div class="container">
        <a class="navbar-brand" href="list.action">
            博客导航
        </a>

        <div class="navbar-collapse collapse" id="nav1">
            <ul class="navbar-nav">
                <li class="nav-item ml-3">
                    <a class="nav-link" href="list.action">首页</a>
                </li>
<%--                <li class="nav-item">--%>
<%--                    <a class="nav-link" href="list.action">帖子列表</a>--%>
<%--                </li>--%>
                <li class="nav-item">
                    <a class="nav-link" href="add.action">发表帖子</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="tochartstat.action">数据统计</a>
                </li>

                <form class="form-inline" action="list.action" method="post"
                style="margin-top: 20px;text-align: center">
                    <div class="form-group">
                        <input type="text" class="form-control"
                               id="searchInfo" name="searchInfo" placeholder="输入标题或作者">
                    </div>
                    <button type="submit" class="btn btn-info">SEARCH</button>
                </form>

            </ul>
            <ul class="navbar-nav ml-auto">
                <c:if test="${currentUser==null}">
                    <li class="nav-item">
                        <a class="nav-link" href="tologin.action">用户登录</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="toregist.action">用户注册</a>
                    </li>
                </c:if>
                <c:if test="${currentUser!=null}">
                    <li class="nav-item">
                        <a class="nav-link" href="personlist.action?uid=${currentUser.uid}">我的帖子</a>
                    </li>
                    <li class="nav-item"><a class="nav-link">登录人：${currentUser.name}</a></li>
                    <li class="nav-item"><a class="nav-link" href="exit.action">退出</a></li>
                </c:if>
            </ul>
        </div>
    </div>
</nav>